
@echo off
setlocal enabledelayedexpansion
for %%f in (*.cpp) do (
    set "filename=%%f"
    ren "!filename!" "!filename:.cpp=.c!"
)
endlocal